package com.yidu.logisticssystem.controller;

import com.yidu.logisticssystem.entity.LogisticsCharge;
import com.yidu.logisticssystem.service.LogisticsChargeService;
import com.yidu.logisticssystem.utils.BaseMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 运费计价标准(LogisticsCharge)表控制层
 *
 * @author makejava
 * @since 2021-03-15 13:59:53
 */
@Api(tags= "运费计价标准接口")
@RestController
@RequestMapping("logisticsCharge")
public class LogisticsChargeController {
    /**
     * 服务对象
     */
    @Resource
    private LogisticsChargeService logisticsChargeService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public LogisticsCharge selectOne(Integer id) {
        return this.logisticsChargeService.queryById(id);
    }

    /**
     *
     * @param charge
     * @return 单条数据
     */
    @ApiOperation(value = "条件查询运费计价标准",notes = "返回运费计价标准")
    @GetMapping("findMapId")
    public BaseMessage findMapId(LogisticsCharge charge){
        return BaseMessage.succes(logisticsChargeService.queryByMapId(charge));
    }
}
